<?php

if( ! defined('DOCROOT') )
{
    require_once '/var/www/advancelab/chilik2/unittest/bootstrap.php';
}

class ResponseTest extends UnitTestCase
{
    function testingResponse()
    {
        $struct = new Entity\Response();
        
        $this->assertIdentical($struct,new Entity\Response);
        $this->assertTrue($struct instanceof Entity\Response);
        
        $struct->status = 'php';
        $this->assertEqual( 'php', $struct->status );
        $struct->date = 'ezc';
        $this->assertEqual( 'ezc', $struct->date );
        $struct->generator = 'ezp';
        $this->assertEqual( 'ezp', $struct->generator );
        $struct->cache = 'buddymiles';
        $this->assertEqual( 'buddymiles', $struct->cache );
        $struct->cookies = 'buddyguy';
        $this->assertEqual( 'buddyguy', $struct->cookies );
        $struct->content = 'django';
        $this->assertEqual( 'django', $struct->content );
        $struct->body = 'satchmo';
        $this->assertEqual( 'satchmo', $struct->body );
        
        /* $this->dump($struct); */
    }
    
    public function testMockingMethod()
    {
        $state = array(
        'status' => 'php',
        'date' => 'ezc',
        'generator' => 'ezp',
        'cache' => 'buddymiles',
        'cookies' => 'buddyguy',
        'content' => 'django',
        'body' => 'satchmo',
        );
        
        $struct = Entity\Response::__mock( $state );
        
        $this->assertEqual( 'php', $struct->status );
        $this->assertEqual( 'ezc', $struct->date );
        $this->assertEqual( 'ezp', $struct->generator );
        $this->assertEqual( 'buddymiles', $struct->cache );
        $this->assertEqual( 'buddyguy', $struct->cookies );
        $this->assertEqual( 'django', $struct->content );
        $this->assertEqual( 'satchmo', $struct->body );
    }
}

